﻿using System;

namespace diantou.dataModel
{
    /// <summary>
    /// 话题名称
    /// </summary>
    [fastCSharp.code.cSharp.webView.clientType(Name = "diantou.topic")]
    public class topicName
    {
        /// <summary>
        /// 话题标识
        /// </summary>
        [fastCSharp.code.cSharp.webView.outputAjax]
        public int Id;
        /// <summary>
        /// 话题名称
        /// </summary>
        [fastCSharp.emit.dataMember(MaxStringLength = 256)]
        public string Name;
    }
    /// <summary>
    /// 话题
    /// </summary>
    [fastCSharp.emit.jsonSerialize(IsAllMember = true)]
    [fastCSharp.emit.jsonParse(IsAllMember = true)]
    [fastCSharp.emit.dataSerialize(IsReferenceMember = false, IsMemberMap = false)]
    [fastCSharp.code.cSharp.sqlModel]
    public partial class topic : topicName
    {
        /// <summary>
        /// 重定向话题标识
        /// </summary>
        public int LinkId;
        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime = fastCSharp.date.NowSecond;
        [Flags]
        public enum lockType : byte
        {
            /// <summary>
            /// 标题
            /// </summary>
            Name = 1,
            /// <summary>
            /// 相关话题
            /// </summary>
            Topic = 2,
            /// <summary>
            /// 描述
            /// </summary>
            Remark = 4,
            /// <summary>
            /// 图片
            /// </summary>
            Icon = 8,
        }
        /// <summary>
        /// 锁定状态
        /// </summary>
        [fastCSharp.emit.dataMember(DataType = typeof(byte))]
        public lockType LockFlags;
        /// <summary>
        /// 创建者用户标识
        /// </summary>
        //[fastCSharp.code.cSharp.json(IsIgnoreCurrent = true)]
        //[fastCSharp.emit.dataMember(Link = typeof(user))]
        public int UserId;
        /// <summary>
        /// 最后修改名称的用户标识
        /// </summary>
        //[fastCSharp.emit.dataMember(Link = typeof(user))]
        public int ReworkNameUserId;
        /// <summary>
        /// 最后修改描述的用户标识
        /// </summary>
        //[fastCSharp.emit.dataMember(Link = typeof(user))]
        public int ReworkRemarkUserId;
        /// <summary>
        /// 最后修改图片的用户标识
        /// </summary>
        //[fastCSharp.emit.dataMember(Link = typeof(user))]
        public int ReworkIconUserId;
        /// <summary>
        /// 图片
        /// </summary>
        [fastCSharp.emit.dataMember(IsAscii = true, MaxStringLength = 64)]
        public sqlMember.image Icon = string.Empty;
        /// <summary>
        /// 分类
        /// </summary>
        [Flags]
        public enum category
        {
            None = 0,
            Alias = 1,
            Category = 2,

            Regional = 0X10,
            University = 0X20,
            Building = 0X40,
            Restaurant = 0X80,
            Entertainment = 0X100,
            Shop = 0X200,

            Movie = 0X1000,
            TV = 0X2000,
            Music = 0X4000,
            Book = 0X8000,
            Magazine = 0X10000,

            Person = 0X80000,
            Food = 0X100000,
            Website = 0X200000,
            Company = 0X400000,
            Job = 0X800000,
            Luxury = 0X1000000,

            Catelog = 0X10000000,
            DesciptionFirst = 0X20000000,
            DesciptionSecond = 0X40000000,
        }
        /// <summary>
        /// 分类
        /// </summary>
        [fastCSharp.emit.dataMember(DataType = typeof(int))]
        public category Category;
        /// <summary>
        /// 非法经纬度
        /// </summary>
        protected const double defaultLongitudeLatitude = 65535;
        /// <summary>
        /// 最小经度
        /// </summary>
        public double West = defaultLongitudeLatitude;//minLongitude
        /// <summary>
        /// 最小纬度
        /// </summary>
        public double South = defaultLongitudeLatitude;//minLatitude
        /// <summary>
        /// 最大经度
        /// </summary>
        public double East = defaultLongitudeLatitude;//maxLongitude
        /// <summary>
        /// 最大纬度
        /// </summary>
        public double North = defaultLongitudeLatitude;//maxLatitude

        /// <summary>
        /// 话题描述
        /// </summary>
        [fastCSharp.emit.dataMember(Group = 1, MaxStringLength = 1 << 20)]
        public string Remark = string.Empty;

        /// <summary>
        /// 关注者数量
        /// </summary>
        [fastCSharp.emit.dataMember(IsIgnoreCurrent = true)]
        public int FocusCount;
        ///// <summary>
        ///// @提到的数量
        ///// </summary>
        //[fastCSharp.emit.dataMember(IsIgnoreCurrent = true)]
        //public int MentionCount;
        /// <summary>
        /// 收藏次数
        /// </summary>
        [fastCSharp.emit.dataMember(IsIgnoreCurrent = true)]
        public int FavoriteCount;
    }
}
